package cn.explink.distributor.framework;

import java.util.ArrayList;
import java.util.List;

/**
 * 订单群组
 *
 * @author songkaojun 2015年5月11日
 */
public class OrderCluster extends AbstractOrder {

	/**
	 * 中心点
	 */
	private Center center;

	/**
	 * 此群组包含的订单
	 */
	private List<Order> orderList = new ArrayList<Order>();

	public OrderCluster(Center center) {
		super();
		this.center = center;
	}

	public OrderCluster(Center center, List<Order> orderList) {
		super();
		this.center = center;
		this.orderList = orderList;
	}

	public OrderCluster(double lng, double lat, List<Order> orderList) {
		super();
		this.center = new Center(lng, lat);
		this.orderList = orderList;
	}

	public void addOrder(Order order) {
		this.orderList.add(order);
	}

	public void removeOrder(Order order) {
		this.orderList.remove(order);
	}

	public Center getCenter() {
		return this.center;
	}

	public void setCenter(Center center) {
		this.center = center;
	}

	public List<Order> getOrderList() {
		return this.orderList;
	}

	public void setOrderList(List<Order> orderList) {
		this.orderList = orderList;
	}

	public class Center {
		private double lng = 0;
		private double lat = 0;

		public Center(double lng, double lat) {
			super();
			this.lng = lng;
			this.lat = lat;
		}

		public double getLng() {
			return this.lng;
		}

		public void setLng(double lng) {
			this.lng = lng;
		}

		public double getLat() {
			return this.lat;
		}

		public void setLat(double lat) {
			this.lat = lat;
		}

	}
}
